﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AutoStar
{
    class Personal
    {
        private string userName;
        private string password;
        private string passwordHash;
        private bool role;
        private string name;
        private string surname;
        private string account;
        private string email;
        private string street;
        private int cityKey;
        private int countryKey;

        public string Street
        {
            set { street = value; }
            get { return street; }
        }
        public string UserName
        {
            set { userName = value; }
            get { return userName; }
        }
        public string Password 
        {
            set { password = value;
            passwordHash = Convert.ToString((new CalculateMD5Hash()).GetMD5Hash(password.Trim(),50));            
            }
            get{ return password;}
        }
        public string PasswordHash
        {
            get { return passwordHash; }
        }
        public bool Role
        {
            set { role = value; }
            get { return role; }
        }
        public string Name
        {
            set { name = value; }
            get { return name; }
        }
        public string Surname
        {
            set { surname = value; }
            get { return surname; }
        }
        public string Account
        {
            set { account = value; }
            get { return account; }
        }
        public string EMail 
        {
            set { email = value; }
            get { return email; }
        }
        public int CityKey
        {
            set { cityKey = value; }
            get { return cityKey; }
        }
        public int CountryKey
        {
            set { countryKey = value; }
            get { return countryKey; }
        }
        public Personal()
        {
            userName = null;
            password = null;
            passwordHash = null;
            role = false;
            name = null;
            surname = null;
            account = null;
            email = null;
            cityKey = 0;
            countryKey = 0;
        }
        public Personal(string user, string pass, bool uloga, string ime, string prezime, string racun, string mail, int grad, int zemlja)
        {
            userName = user;
            this.Password = pass;
            role = uloga;
            name = ime;
            surname = prezime;
            account = racun;
            email = mail;
            cityKey = grad;
            countryKey = zemlja;
        }
    }
}
